package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.Identifier;

/**
 * @author Bright Lee
 */
public final class RollbackStatement implements SqlTransactionStatement, Statement {

    private int beginIndex;
    private int endIndex;
    private boolean work;
    private boolean andChain;
    private boolean andNoChain;
    private Identifier savepointSpecifier;

    public RollbackStatement(int beginIndex,
                             int endIndex,
                             boolean work,
                             boolean andChain,
                             boolean andNoChain,
                             Identifier savepointSpecifier) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
        this.work = work;
        this.andChain = andChain;
        this.andNoChain = andNoChain;
        this.savepointSpecifier = savepointSpecifier;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public boolean isWork() {
        return work;
    }

    public boolean isAndChain() {
        return andChain;
    }

    public boolean isAndNoChain() {
        return andNoChain;
    }

    public Identifier getSavepointSpecifier() {
        return savepointSpecifier;
    }

}
